import { apiRequest, handleApiError } from '../../utils/apiClient';

export default defineEventHandler(async (event) => {
  try {
    //如何获取newsid 
    const query = getQuery(event) 
    // 获取分页和分类参数
    const params = {
      pageindex: Number(query.pageindex) || 1,
      num: Number(query.num) || 8,
      agencyid: query.agencyId as string
    }; 
    const agencyId = query.agencyid
    return await apiRequest("govaffair.content.agencynewslist", params, 'post');
  } catch (error) {
    return handleApiError(error, []);
  }
});